package me.dqn.noway.bean;

import java.io.Serializable;

public class PasswordInformation implements Serializable {

    public static final String TYPE_IS_EMPTY = "TYPE IS EMPTY";
    public static final String OK = "OK";


    private int id;

    // 账户名
    private String username;

    // 账户密码
    private String password;

    // 邮箱
    private String mail;

    // 类型，注册地
    private String type;

    // 备注
    private String detail;

    private int userId;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getMail() {
        return mail;
    }

    public void setMail(String mail) {
        this.mail = mail;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public int getUserId() {
        return userId;
    }


    public void setUserId(int userId) {
        this.userId = userId;
    }

    @Override
    public String toString() {
        return "PasswordInfomation{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", mail='" + mail + '\'' +
                ", type='" + type + '\'' +
                ", detail='" + detail + '\'' +
                ", userId=" + userId +
                '}';
    }

    public String validate() {
        if (type == null || type.isEmpty() || type.trim().isEmpty()) {
            return TYPE_IS_EMPTY;
        } else {
            return OK;
        }
    }

}
